﻿using System;
using System.Collections.Generic;
using System.Text;
using Lswweb.Domain;
using Lswweb.Model;


namespace Lswweb.Controls
{
    public class OrderList : SkinnedGridView<OrderInfo>
    {
        protected override IList<OrderInfo> GridViewDataSourceHandler(int pageIndex, int pageSize, out int totalRecord)
        {
            int userId = (SiteContext.Current.User.IsAdmin && SiteContext.Current.MapNode!=null && SiteContext.Current.MapNode.Type== MapType.AdminMenu) ? -1 : SiteContext.Current.User.Id;

            return Orders.GetOrders(userId,Status, pageSize, pageIndex, out totalRecord);
        }

        public OrderStatus Status { get; set; }


        protected override string DefaultSkinFilename
        {
            get { return "Order/OrderList.ascx"; }
        }
    }
}
